home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue70 / Clinic / COMSolution2 / ComClass1Impl.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-04-05  |  625 b   |  34 lines

  1. unit ComClass1Impl;
  2.  
  3. interface
  4.  
  5. uses
  6.   BaseLib_TLB, Windows, ActiveX, Classes, ComObj;
  7.  
  8. type
  9.   TComClass1 = class(TComObject, IFoo)
  10.   protected
  11.     {Declare IFoo methods here}
  12.     procedure Bar; safecall;
  13.   end;
  14.  
  15. //const
  16. //  Class_ComClass1: TGUID = '{1D02060B-0A08-4E8F-A57A-CCAF038445AF}';
  17.  
  18. implementation
  19.  
  20. uses
  21.   ComServ, Dialogs, CommonUnit;
  22.  
  23. { TComClass1 }
  24.  
  25. procedure TComClass1.Bar;
  26. begin
  27.   ShowMessage('Hello from a TComClass1 in ComServer1.dll')
  28. end;
  29.  
  30. initialization
  31.   TComObjectFactory.Create(ComServer, TComClass1, SharedClassID,
  32.     'ComClass1', '', ciInternal, tmApartment);
  33. end.
  34.